import request from './request'

/**
 * 评论/回复评论
 * @param {int} videoId 视频id
 * @param {string} content 评论内容
 * @returns 
 */
export const apiAddcomment = (videoId,content) => {
    return request.post(`/videoComment/${videoId}/${content}`)
}

/**
 * 获取视频下的评论
 * @param {int} videoId 视频id
 * @param {int} page 当前页
 * @param {int} limit 条数
 * @returns 
 */
export const apiGetComment = (videoId, page=1,limit=10)=>{
    return request.get(`/videoComment/by/${videoId}`,{
        params: {
            page: page,
            limit: limit
        }
    })
}

/**
 * 删除评论
 * @param {int} commentId 评论id
 * @returns 
 */
export const apiDeleteComment = (commentId) => {
    return request.delete(`/videoComment/${commentId}`)
}